package com.wu.system.controller.wx;

import com.wu.common.page.PageResult;
import com.wu.common.utils.Result;
import com.wu.dao.weixin.vo.WeixinGzUserVo;
import com.wu.service.sys.query.SysUserQuery;
import com.wu.service.weixin.service.WxGzUserService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;


/**
 * 用户管理
 *
 * @author wzd 
 */
@RestController
@RequestMapping("wx/gzuser")
@AllArgsConstructor
@Tag(name="微信用户管理")
public class WxGzUserController {
    @Autowired
    private WxGzUserService wxGzUserService;


    @GetMapping("page")
    @Operation(summary = "分页")
    @PreAuthorize("hasAuthority('sys:user:page')")
    public Result<PageResult<WeixinGzUserVo>> page(@Valid SysUserQuery query){
        PageResult<WeixinGzUserVo> page = wxGzUserService.page(query);
        return Result.ok(page);
    }

}
